package com.example.testiuh;


import java.util.ArrayList;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListView;

public class DataList_Activity extends Activity{
	private static int currentListData;

	ArrayList<Bus> testBuses = new ArrayList<Bus>();
	ArrayList<CTDT> testCTDT = new ArrayList<CTDT>();
	
	private ListView listData;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_list);

		initTestData();
		listData = (ListView) findViewById(R.id.listData);
		currentListData = getIntent().getExtras().getInt("listType");
		
		if(currentListData==MainActivity.BusList){
			listData.setAdapter(new Bus_Adapter(this, R.layout.item_listbus, testBuses));
		}
		else{
			listData.setAdapter(new CTDT_Adapter(this, R.layout.item_listdaotao, testCTDT));
		}
		
		
			

	}

	private void initTestData() {
		testBuses.add( new Bus("tuyen1","18","batdau1","ketthuc1","tuyendi1","tuyenve1"));
		testBuses.add(new Bus("tuyen2","24","batdau1","ketthuc1","tuyendi1","tuyenve1"));
		testBuses.add(new Bus("tuyen3","145","batdau1","ketthuc1","tuyendi1","tuyenve1"));
		
		testCTDT.add(new CTDT("CNTT", "exporl.htm"));
		testCTDT.add(new CTDT("BANK", "overflow.htm"));
	}
}
